/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.examat.entidades;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author Fer
 */
@Embeddable
public class CarreraEsDeTipoexamenPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "Id_TipoExamen")
    private int idTipoExamen;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 3)
    @Column(name = "Clave_Carrera")
    private String claveCarrera;

    public CarreraEsDeTipoexamenPK() {
    }

    public CarreraEsDeTipoexamenPK(int idTipoExamen, String claveCarrera) {
        this.idTipoExamen = idTipoExamen;
        this.claveCarrera = claveCarrera;
    }

    public int getIdTipoExamen() {
        return idTipoExamen;
    }

    public void setIdTipoExamen(int idTipoExamen) {
        this.idTipoExamen = idTipoExamen;
    }

    public String getClaveCarrera() {
        return claveCarrera;
    }

    public void setClaveCarrera(String claveCarrera) {
        this.claveCarrera = claveCarrera;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) idTipoExamen;
        hash += (claveCarrera != null ? claveCarrera.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CarreraEsDeTipoexamenPK)) {
            return false;
        }
        CarreraEsDeTipoexamenPK other = (CarreraEsDeTipoexamenPK) object;
        if (this.idTipoExamen != other.idTipoExamen) {
            return false;
        }
        if ((this.claveCarrera == null && other.claveCarrera != null) || (this.claveCarrera != null && !this.claveCarrera.equals(other.claveCarrera))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.examat.entidades.CarreraEsDeTipoexamenPK[ idTipoExamen=" + idTipoExamen + ", claveCarrera=" + claveCarrera + " ]";
    }
    
}
